import { ActiveChartForm } from "./ChartForm";
import { ChartFormItemContext } from "./ChartFormItem";
import { IChartFormItem } from "./ChartItemType";





export function useFormState(formItemContext: IChartFormItem) {
    if (ActiveChartForm == null) {
        throw new Error("no ActiveChartForm, please make sure use hooks used in ChartForm Functions!");
    }
    return ActiveChartForm._useFormState.call(ActiveChartForm, formItemContext);

}
export function useFormComputed(props: ChartFormItemContext | ChartFormItemContext[], effectFn: () => any) {
    if (ActiveChartForm == null) {
        throw new Error("no ActiveChartForm, please make sure use hooks used in ChartForm Functions!");
    }
    return ActiveChartForm._useComputed.call(ActiveChartForm, props, effectFn);
}
export function useFormCommonItems(propName: string | string[]) {
    if (ActiveChartForm == null) {
        throw new Error("no ActiveChartForm, please make sure use hooks used in ChartForm Functions!");
    }
    return ActiveChartForm._injectState.call(ActiveChartForm, propName);
}